<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <%include file="include/edit_nav.html"%>
    <div class="div-info-body">
      <div class="right">
	<a href="/relation/add?userid=<%$user.id%>">添加新成员</a>
	<a href="/users/search?userid=<%$user.id%>">从已存在成员中添加关系</a>
      </div>

      <%if $relations.mothers || $relations.fathers || $relations.mates || $relations.sons%>
      <table>
        <caption>
	  家庭成员
        </caption>
	<tr>
	  <th class="version">编号</th>
	  <th class="version">称谓</th>
	  <th class="date">姓名</th>
	  <th class="state">状态</th>
	  <th class="op">操作</th>
	</tr>      
	<%foreach from=$relations key=type item=relation %>
	<%if $relation|@count gt 0%>
	<%foreach from=$relation item=person %>
	<tr>
	  <td><%$person.relation_id%></td>
	  <td><%$relation_names.$type%></td>
          <td><%$person.realname%></td>
          <td><%if $person.state eq $RESOURCE_STATE_DELETED%>已删除<%else%>正常<%/if%></td>
          <td>
            <a href="/relation/delete?userid=<%$user.id%>&relationid=<%$person.relation_id%>">删除</a><br/>
            <a href="/relation/history?userid=<%$user.id%>&relationid=<%$person.relation_id%>">历史记录</a>
	  </td>
	</tr>
	<%/foreach%>
	<%/if%>
	<%/foreach%>
	<tr>
	  <td colspan="8">

	  </td>
	</tr>

      </table>
      <%else%>
      <span class="warnning">
	没有家庭成员！
      </span>
      <%/if%>

    </div>
    <div class="clear">
    </div>
  </div>
</div>
<%include file="include/bottom.html"%>

